public class PriceCalculator {
    public double calculate(double price, User user) {
        double discount = user.getType().getDiscount();
        return price * discount;
    }
}